import Vue from 'vue'
import VueRouter from 'vue-router'
import Layout from '../views/Layout'// 首页
import Article from '../views/Article'// 面经
import Support from '../views/Support'// 问答SupportPage
import Video from '../views/Video'// 视频
import User from '../views/User'// 我的
import ArticleDetail from '../views/ArticleDetail'// 面经详情
import Login from '../views/Login.vue'// 登录
Vue.use(VueRouter)

const router = new VueRouter({
  routes: [
    {
      path: '/',
      component: Layout,
      // 路由嵌套
      children: [
        // 二级路由页面 1首页
        { path: '/article', component: Article },
        // 二级路由页面 2问答
        { path: '/support', component: Support },
        // 二级路由页面 3视频
        { path: '/video', component: Video },
        // 二级路由页面 4我的
        { path: '/user', component: User }
      ]
    },
    { path: '/detail/:id', component: ArticleDetail },
    { path: '/login', component: Login }
  ]
})

export default router
